import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './views/App.vue'
import store from './vuex/store'
import router from './router'
import { sync } from 'vuex-router-sync'
import { native } from './native'

Vue.use(ElementUI)
// component
import pickerDate from './components/PickerDate.vue'
import pickerTime from './components/PickerTime.vue'
import selectBox from './components/SelectBox.vue'
import selectOption from './components/SelectOption.vue'
import upload from './components/Upload.vue'
import uploadSingle from './components/UploadSingle.vue'
import confirm from './components/Confirm.vue'
import loading from './components/Loading.vue'
import imageView from './components/ImageView.vue'
import secondFormat from './filters/filter-secondFormat'


Vue.component('picker-date', pickerDate)
Vue.component('picker-time', pickerTime)
Vue.component('select-box', selectBox)
Vue.component('select-option', selectOption)
Vue.component('upload', upload)
Vue.component('upload-single', uploadSingle)
Vue.component('confirm', confirm)
Vue.component('loading', loading)
Vue.component('image-view', imageView)

Vue.filter('secondFormat', secondFormat)
sync(store, router)

const init = ()=> {
    let app = new Vue({
        router,
        store,
        render: h => h(App)
    }).$mount('#app')
}

native(init)

